import { Injectable } from '@angular/core';
import {Observable} from "rxjs/Observable";
import {MsgResult} from "../../../../models/msg-result";
import {DamAPI} from "../../peach-constants";
import {RequestUtil} from "../../../../util/request-util";

@Injectable()
export class PolluteDataService {

  constructor(
    private requestUtil: RequestUtil
  ) { }



//工业废气
  getIndustryData(obj):Observable<MsgResult>{
    let params = "format=json&dataType="+obj.dataType+"&startTime="+obj.startTime+"&endTime="+obj.endTime+"&siteCodes="+obj.siteCodes;
    return this.requestUtil.get(DamAPI.getIndustryData,params);
  }
//扬尘
  getRaiseDustData(obj):Observable<MsgResult>{
    let params = "format=json&dataType="+obj.dataType+"&startTime="+obj.startTime+"&endTime="+obj.endTime+"&siteCodes="+obj.siteCodes;
    return this.requestUtil.get(DamAPI.getRaiseDustData,params);
  }
//工业废水
  getWaterData(obj):Observable<MsgResult>{
    let params = "format=json&dataType="+obj.dataType+"&startTime="+obj.startTime+"&endTime="+obj.endTime+"&siteCodes="+obj.siteCodes;
    return this.requestUtil.get(DamAPI.getWaterData,params);
  }
//油烟
  getLampblackData(obj):Observable<MsgResult>{
    let params = "format=json&dataType="+obj.dataType+"&startTime="+obj.startTime+"&endTime="+obj.endTime+"&siteCodes="+obj.siteCodes;
    return this.requestUtil.get(DamAPI.getLampblackData,params);
  }

  //获取下拉列表
  getPollutantSiteData():Observable<MsgResult>{
    let params = "format=json&pointType=allPollutionSite";
    return this.requestUtil.get(DamAPI.getPollutantSiteData,params);
  }




  //不同用户不同站点
  getUserSiteData():Observable<MsgResult>{
    return this.requestUtil.get(DamAPI.getUserSite);
  }


}
